<?php 
/*
$_GET["articleid"];

*/
require("errorhandle.php");

require("phpconnect.php");

$articleid=$_GET["articleid"]; //文章id
$articleEncode = base64_decode($articleid);
$tmpsub = strpos($articleEncode,"_fucky");
if (!isset($tmpsub)||$tmpsub<=0) //解密错误
{
	errorHandle(paramerror);
	return;
}
else
{
	$articleid=substr($articleEncode,0,$tmpsub);
	$articleid=($articleid-467)/23;
}
	
//echo $articleEncode;
$result = mysql_query("SELECT title,pubtime,source,content FROM article where id=" . $articleid );
if(!$result)
{
    mysql_close($con);
    errorHandle($queryarticlelerror);
	return;
}

$article=new Article;


while($row = mysql_fetch_array($result))
{
	$article->title=$row['title'];
	$article->source=$row['source'];
	$article->time=$row['pubtime'];
	$article->content=$row['content'];
	break;
}

$article_json = json_encode($article);
echo $article_json;
mysql_close($con);


//文章
class Article
{
	public $title;
	public $source;
	public $time;
	public $content;
}


?>